<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on April 7, 2009 at 3:52:49 pm</time-stamp>


<class>
<name>SupplierAppModel</name>
<environment>SupplyChain</environment>
<super>UI.SimpleDialog</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>inventoryList itemList invoiceList lotNum price model </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.SupplierAppModel class</class-id> <category>interface specs</category>

<body package="SupplyChain" selector="windowSpec">windowSpec
	"Tools.UIPainter new openOnClass: self andSelector: #windowSpec"

	&lt;resource: #canvas&gt;
	^#(#{UI.FullSpec} 
		#window: 
		#(#{UI.WindowSpec} 
			#label: 'Supplier Main GUI' 
			#bounds: #(#{Graphics.Rectangle} 640 512 951 785 ) ) 
		#component: 
		#(#{UI.SpecCollection} 
			#collection: #(
				#(#{UI.LabelSpec} 
					#layout: #(#{Core.Point} 4 250 ) 
					#name: #supplierGUI 
					#label: 'Supplier Main GUI' ) 
				#(#{UI.SequenceViewSpec} 
					#layout: #(#{Graphics.Rectangle} 16 58 156 226 ) 
					#name: #inventoryList 
					#model: #inventoryList 
					#useModifierKeys: true 
					#selectionType: #highlight ) 
				#(#{UI.LabelSpec} 
					#layout: #(#{Core.Point} 19 32 ) 
					#name: #supplierInventory 
					#label: 'Supplier Inventory' ) 
				#(#{UI.ActionButtonSpec} 
					#layout: #(#{Graphics.Rectangle} 186 166 267 189 ) 
					#name: #createLot 
					#model: #createLotClick 
					#label: 'Create Lot' 
					#defaultable: true ) 
				#(#{UI.ActionButtonSpec} 
					#layout: #(#{Graphics.Rectangle} 171 89 291 112 ) 
					#name: #outstandingInvoices 
					#model: #outstandingInvoicesClick 
					#label: 'Outstanding Invoices' 
					#defaultable: true ) 
				#(#{UI.ActionButtonSpec} 
					#layout: #(#{Graphics.Rectangle} 108 239 189 262 ) 
					#name: #accept 
					#model: #accept 
					#label: 'Done' 
					#defaultable: true ) 
				#(#{UI.ActionButtonSpec} 
					#layout: #(#{Graphics.Rectangle} 208 238 289 261 ) 
					#name: #cancel 
					#model: #cancel 
					#label: 'Cancel' 
					#defaultable: true ) ) ) )</body>
</methods>

<methods>
<class-id>SupplyChain.SupplierAppModel class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.SupplierAppModel</class-id>
<body>SupplierAppModel holds the supplier's inventory, an option to create lots, view reports and outstanding invoices. 

Instance Variables:
	inventoryList	&lt;Object&gt;	list of supplier's inventory 
	invoiceList	&lt;Object&gt;	show's supplier's invoice 
	itemList	&lt;Object&gt;	list of items
	lotNum	&lt;Object&gt;	lot number of item
	price	&lt;Object&gt;	price of item

</body>
</comment>

<methods>
<class-id>SupplyChain.SupplierAppModel</class-id> <category>aspects</category>

<body package="SupplyChain" selector="inventoryList">inventoryList
	"This method was generated by UIDefiner.  Any edits made here
	may be lost whenever methods are automatically defined.  The
	initialization provided below may have been preempted by an
	initialize method."

	^inventoryList isNil
		ifTrue:
			[inventoryList := SelectionInList new]
		ifFalse:
			[inventoryList]</body>
</methods>

<methods>
<class-id>SupplyChain.SupplierAppModel</class-id> <category>accessing</category>

<body package="SupplyChain" selector="model">model

	^model</body>

<body package="SupplyChain" selector="model:">model: aSupplier

	model:= aSupplier.
	^self</body>
</methods>

<methods>
<class-id>SupplyChain.SupplierAppModel</class-id> <category>actions</category>

<body package="SupplyChain" selector="createLot">createLot

	"This stub method was generated by UIDefiner"

	^self</body>

<body package="SupplyChain" selector="createLotClick">createLotClick	
	"This stub method was generated by UIDefiner"
	" opens the Gui dialog to create a new lot	"
	|gui 	|
	
	gui:= SupplierNewLotDialog new.
	"set the appModel's data to the current selection	"
	gui model: model inventory.	
	"copy the supplier's current inventory to the temp inventory"

	
	gui open.

	self changed: #inventory.
	^self</body>

<body package="SupplyChain" selector="outstandingInvoices">outstandingInvoices

	"This stub method was generated by UIDefiner"

	^self</body>

<body package="SupplyChain" selector="outstandingInvoicesClick">outstandingInvoicesClick

	"This stub method was generated by UIDefiner"

	SupplierOutstandingInvoicesDialog open.
	^self</body>

<body package="SupplyChain" selector="viewReports">viewReports

	"This stub method was generated by UIDefiner"

	^self</body>

<body package="SupplyChain" selector="viewReportsClick">viewReportsClick

	"This stub method was generated by UIDefiner"

	^self</body>
</methods>

<methods>
<class-id>SupplyChain.SupplierAppModel</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
   super initialize.
   "Make the instance of our domain model.  We make model an instance variable so we can use it in other methods."
   model := Supplier new.
   
   "now we set up the list box for inventory.  We set the model of the list box to be a selectable item"
    
    (inventoryList:= SelectionInList new) listHolder: ((UI.AspectAdaptor subject: (model inventory) sendsUpdates: true)forAspect: #items).

	^self</body>
</methods>

</st-source>
